/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.pv.hibernatepokus.domain;

import java.io.Serializable;
import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 *
 * @author Premek
 */
@Embeddable
public class ItemPk implements Serializable {
    
    @ManyToOne
    @JoinColumn(name="invoiceid")
    private Invoice invoice;
        
    private int item;

    public ItemPk() {
    }
    
    public ItemPk(Invoice invoice, int item) {
        this.invoice = invoice;
        this.item = item;
    }

    public Invoice getInvoice() {
        return invoice;
    }

    public void setInvoice(Invoice invoice) {
        this.invoice = invoice;
    }

    public int getItem() {
        return item;
    }

    public void setItem(int item) {
        this.item = item;
    }

    @Override
    public String toString() {
        return "ItemPk{" + "invoice=" + invoice + ", item=" + item + '}';
    }
    
}
